﻿#ifndef JZGL_GEMO_H_
#define JZGL_GEMO_H_

#include <QVector3D>

class JZPlane
{
public:
    QVector3D normal() const; //法向量

    float A;
    float B;
    float C;
    float D;
};

class JZLine
{
public:
    QVector3D point;
    QVector3D direction;
};

// 三点是否共线
bool arePointsCollinear(const QVector3D& a, const QVector3D& b, const QVector3D& c);

// 计算平面方程
bool calculatePlane(const QVector3D& a, const QVector3D& b, const QVector3D& c, JZPlane* plane);

// 点到直线距离
float distanceToPlane(const QVector3D& pt,const JZPlane& plane);

// 计算两个平面之间的夹角（以弧度为单位）
float calculatePlaneAngle(const JZPlane& plane1, const JZPlane& plane2);

// 计算线段到平面交点
bool lineIntersectionPlane(const JZLine& line, JZPlane& plane, QVector3D& inster);


// 计算与给定平面垂直且过两点的平面方程系数


#endif // !JZGL_GEMO_H_
